package com.ctrip.study.spring;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class XmlBeanFactoryTest {
	
	public static void main(String[] args) {
		ClassPathResource res = new ClassPathResource("applicationContext-myStudy.xml");
		DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
		XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
		reader.loadBeanDefinitions(res);
		Person person = (Person)factory.getBean("person");
		System.out.println(person.getName());
	}

}
